<?php

session_start();

$accion = $_GET['accion'];
$objSesion = new Session();
switch ($accion) {
    case "crearSesionCita": $objSesion->CrearSesionCita();
        break;
    case "quitarSesionCita": $objSesion->QuitarSesionCita();
        break;
}

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class Session {

    public function crear($session) {

        //header("Cache-control: private");
        $_SESSION['IdUsuario'] = $session[0];
        $_SESSION['IdPersona'] = $session[1];
        $_SESSION['Nombre'] = $session[2];
        $_SESSION['Permisos'] = $session[3];
        $_SESSION['idioma'] = $session[4];
        $_SESSION['IdEmpleado'] = $session[5];

        $_SESSION['IdPersonaCons'] = $session[1];
    }

    public function crearOpcion($opciones){
        
        $_SESSION['opciones'] = $opciones;
    }
    
    public function destruir() {
        session_unset();
        session_destroy();
        header("Location:index.php");
    }

    public function CrearSesionCita() {
        $_SESSION['idCita'] = $_GET['idCita'];
    }

    public function QuitarSesionCita() {
        unset($_SESSION['idCita']);
    }
    
    public function CrearSesionConsulta() {
        $_SESSION['idConsulta'] = $_GET['idConsulta'];
    }

    public function QuitarSesionConsulta() {
        unset($_SESSION['idConsulta']);
    }

}

?>
